// NozzelSelector.cpp: implementation of the NozzelSelector class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
//#include "resource.h"
#include "NozzleSelector.h"
#include  "Equip.h"
#include "EquipManager.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

NozzleSelector::NozzleSelector()
{
	SetSelectorType(NozzleType);
	m_pNozzle = NULL;
}

NozzleSelector::~NozzleSelector()
{

}

Nozzle* NozzleSelector::GetSelected()
{
	ASSERT(m_pNozzle!=NULL);
	return m_pNozzle;

}

void NozzleSelector::FindObject()
{
	if(!IsContinue()) return;
	
	
	ASSERT(!GetOwnerId().IsNull());
	Equip* pEquip = NULL;
	UESoft::ErrorStatus nState = 
		GetCurEquipManager().FindEquip(GetOwnerId() , pEquip);
	if( nState != UESoft::eManagerSuccess )
	{
		SetState(Select_ObjNotExisted);
		return;
	}
	m_pNozzle = NULL;
	pEquip->GetNozzleManager().FindNozzle(GetCurObjId() ,m_pNozzle);
	SetState(Select_Success);

}
